<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<link href="../../..${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text${pageContext.request.contextPath}/css" />
<link href="${pageContext.request.contextPath}/css/table.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/dwz/themes/default/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="${pageContext.request.contextPath}/dwz/themes/css/core.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>

<table border="0" cellpadding="0" cellspacing="0" class="table_border">
	<tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="table_right">
				<tr>
					<td><font style="font-size: 12px;"><strong>修改用户</strong></font>
					</td>
					<td width="25" height="26" align="left"></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<form id="updateUserForm">
				<input name="id" style="display: none" value="${user.id}">
			<table width="100%" border="0" cellspacing="0" class="table_right">
				<tr>
					<td align="center">
						<table width="100%" border="0" cellspacing="0"
							class="table_padding">
							<tr>
								<td align="center">
									<table border="0" cellpadding="0" cellspacing="0"
										class="box_table" id="box_table2">
										<thead>
											<tr>
												<td class="box_table_even">登录帐号：</td>
												<td class="box_table_odd"><span class="in">
													<input type="text" value="${user.accountNo}" name="accountNo" /> <span class="star">*</span>
												</span></td>
											</tr>
											<tr>
												<td class="box_table_even">用户姓名：</td>
												<td class="box_table_odd"><span class="in">
													<input type="text" value="${user.name}" name="name" /> <span class="star">*</span>
												</span></td>
											</tr>
											<tr>
												<td class="box_table_even">电子邮件：</td>
												<td class="box_table_odd"><span class="in">
													<input type="text" value="${user.email}" name="email" /> <span class="star">*</span>
												</span></td>
											</tr>
											<tr>
												<td class="box_table_even">登录密码：</td>
												<td class="box_table_odd"><span class="in">
													<input type="password" value="${user.password}" name="password" /> <span class="star">*</span>
												</span></td>
											</tr>
											<tr>
												<td class="box_table_even">密码确认：</td>
												<td class="box_table_odd"><span class="in">
													<input type="password" value="${user.password}"  /> <span class="star">*</span>
												</span></td>
											</tr>
											<tr>
												<td class="box_table_even">是否启用：</td>
												<td class="box_table_odd">
													<input class="startRadio"  name="lockStatus" value="1" type="radio" />启用
													<input class="startRadio" name="lockStatus"  value="0" type="radio" />锁定
													<span class="star">*</span></td>
											</tr>
											<tr>
												<td class="box_table_even">失效时间：</td>
												<td class="box_table_odd">
													<input type="text"
														   class="Wdate" onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'%y-%M-{%d+1}'})"
														   name="expireTime" value="${user.editTime eq null?'':user.editTime}" />
													<span class="star">*</span></td>
											</tr>
											<tr>
												<td class="box_table_even">允许访问的IP：</td>
												<td class="box_table_odd"><span class="in">
													<input value="${user.allowIps}" name="allowIps" type="text" size="120" />
												</span></td>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
								</td>
							</tr>
						</table>

						<table border="0" cellpadding="0" cellspacing="0"
							class="operation">
							<thead>
								<tr>
									<td height="24">&nbsp;</td>
								</tr>
							</thead>
						</table>
					</td>
				</tr>
			</table>
			</form>
		</td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="table_padding">
				<tr>
					<td height="21" align="right">
						<table align="left">
							<tr>
								<td width="50px"><a class="button" onclick="updateUser()" href="javascript:void(0)"><span>更新</span></a></td>
								<td width="50px"><a class="button"
									href="javascript:void(window.history.back());"><span>返回</span></a></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<script>
	let status = ${user.lockStatus}+""
	if(status=="1"){
		$("input[class='startRadio']:first").prop("checked","checked");
	}else {
		$("input[class='startRadio']:last").prop("checked","checked");

	}

	function updateUser() {
		$.post("updateUser",$("#updateUserForm").serialize(),function (data) {
			if(data.status==true){
				document.location.href = "forwordPage?pagePath=user/list.jsp";
			}
		});
	}
</script>
